var domContainer = document.querySelector('.container');
var itemHeight = 30;
var duration = 500;
domContainer.addEventListener('click', function (e) {
  if ('H2' === e.target.tagName) {
    openMenu(e.target.nextElementSibling);
  }
});

function openMenu(menudom) {
  console.log(menudom.children.length);
  var config = {
    startValue: 0,
    endValue: itemHeight * menudom.children.length + 'px',
    duration: duration,
    onChangeListener: function (e) {
      menudom.style.height = e + 'px';
    },
    onendListener: function () {
        console.log(object);
    },
  };
  //   createAnimate(config);
}
